{include file="public/layout" /}
<script type="text/javascript" src="__SKIN__/js/clipboard.min.js"></script>
<body class="bodystyle" style="cursor: default; -moz-user-select: inherit;min-width:auto;">
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
{include file="system/left" /}
<div class="page min-hg-c-10" style="min-width:auto;margin-left:100px;">
    <div class="flexigrid htitx">
        <form class="" method="post" id="handlepost" action="{:url('System/web')}" enctype="multipart/form-data" name="form1">
            <div class="ncap-form-default pt0">
                <div class="hDiv">
                    <div class="hDivBox">
                        <table cellspacing="0" cellpadding="0" style="width: 100%">
                            <thead>
                            <tr>
                                <th class="sign w10" axis="col0">
                                    <div class="tc"></div>
                                </th>
                                <th abbr="article_title" axis="col3" class="w10">
                                    <div class="tc">商城状态</div>
                                </th>
                                <th abbr="ac_id" axis="col4">
                                    <div class=""></div>
                                </th>
                            </tr>
                            </thead>
                        </table>
                    </div>
                </div>
                <dl class="row">
                    <dt class="tit">
                        <label for="site_url">商城状态</label>
                    </dt>
                    <dd class="opt">
                        <label class="curpoin"><input id="web_status0" name="web_status" value="0" type="radio" {if condition="!isset($config.web_status) OR empty($config.web_status)"} checked="checked"{/if}>开启</label>
                        &nbsp;
                        <label class="curpoin"><input id="web_status1" name="web_status" value="1" type="radio" {if condition="isset($config.web_status) AND $config.web_status eq 1"} checked="checked"{/if}>关闭</label>
                        <input type="hidden" id="old_web_status" value="{$config.web_status|default='0'}">
                    </dd>
                </dl>
                <div class="hDiv">
                    <div class="hDivBox">
                        <table cellspacing="0" cellpadding="0" style="width: 100%">
                            <thead>
                            <tr>
                                <th class="sign w10" axis="col0">
                                    <div class="tc"></div>
                                </th>
                                <th abbr="article_title" axis="col3" class="w10">
                                    <div class="tc">商城设置</div>
                                </th>
                                <th abbr="ac_id" axis="col4">
                                    <div class=""></div>
                                </th>
                            </tr>
                            </thead>
                        </table>
                    </div>
                </div>
                <dl class="row">
                    <dt class="tit">
                        <label for="web_name">商城名称</label>
                    </dt>
                    <dd class="opt ui-web_name ui-text">
                        <input id="web_name" name="web_name" value="{$config.web_name|default=''}" class="input-txt ui-input" type="text" data-num="15" />
                        <p class="notic">一般不超过15个字符</p>
                        <p class="ui-big-text none">一般不超过15个字符（<span class="ui-textTips">还可以输入15个字符</span>）</p>
                    </dd>
                </dl>
                <dl class="row">
                    <dt class="tit">
                        <label for="web_logo">商城logo</label>
                    </dt>
                    <dd class="opt">
                        <div class="dan-pane">
                            <div class="images_upload images_upload_html" style="display:inline-block;">
                                <a href="javascript:void(0);" onclick="GetUploadify(1, '', 'allimg', 'img_call_back_pc');" class="img-upload no-float" title="点击上传">
                                    <div class="y-line" id="web_logo_local_y_line" {notempty name="$config.web_logo_local"} style="display: none;" {/notempty}></div>
                                    <div class="x-line" id="web_logo_local_x_line" {notempty name="$config.web_logo_local"} style="display: none;" {/notempty}></div>
                                    <img src="{$config.web_logo_local}" id="web_logo_local_src" class="pic_con" {empty name="$config.web_logo_local"} style="display: none;" {/empty}>
                                </a>
                                <a href="javascript:void(0)" onclick="clear_pic('web_logo_local', 'web_logo_local_src', 'web_logo_local_y_line', 'web_logo_local_x_line')" class="delect" title="删除"></a>
                                <input type="hidden" id="web_logo_local" name="web_logo_local" value="{$config.web_logo_local|default=''}">
                            </div>
                            <script type="text/javascript">
                                function img_call_back_pc(fileurl_tmp) {
                                    $('#web_logo_local_y_line, #web_logo_local_x_line').hide();
                                    $('#web_logo_local_src').show().attr('src', fileurl_tmp);
                                    $('#web_logo_local').val(fileurl_tmp);
                                }
                                function clear_pic(id_0, id_1, id_2, id_3) {
                                    $('#' + id_0).val('');
                                    $('#' + id_1).hide().attr('src', '');
                                    $('#' + id_2 + ', #' + id_3).show();
                                }
                            </script>
                        </div>
                    </dd>
                </dl>
                <!-- <dl class="row">
                    <dt class="tit">
                        <label for="web_intro">商城简介</label>
                    </dt>
                    <dd class="opt">
                        <textarea rows="5" cols="60" id="web_intro" name="web_intro" style="height:60px;" class="ui-input">{$config.web_intro|default=''}</textarea>
                    </dd>
                </dl> -->
                <dl class="row">
                    <dt class="tit">
                        <label for="">客服电话</label>
                    </dt>
                    <dd class="opt">
                        <input type="text" id="web_phone" name="web_phone" value="{$config.web_phone}" style="width: 30%;">
                    </dd>
                </dl>
                <div class="hDiv">
                    <div class="hDivBox">
                        <table cellspacing="0" cellpadding="0" style="width: 100%">
                            <thead>
                            <tr>
                                <th class="sign w10" axis="col0">
                                    <div class="tc"></div>
                                </th>
                                <th abbr="article_title" axis="col3" class="w10">
                                    <div class="tc">注册隐私</div>
                                </th>
                                <th abbr="ac_id" axis="col4">
                                    <div class=""></div>
                                </th>
                            </tr>
                            </thead>
                        </table>
                    </div>
                </div>
                <dl class="row">
                    <dt class="tit">
                        <label for=""><em>*</em>协议名称</label>
                    </dt>
                    <dd class="opt">
                        <input name="agreement[1][title]" id="reg_agreement_title" value="{$agreement[1]['title']|default=''}" autocomplete="off" placeholder="" type="text" class="input-txt"/>
                        <input name="agreement[1][id]" value="{$agreement[1]['id']|default=0}" type="hidden"/>
                        <input name="agreement[1][type]" value="{$agreement[1]['type']|default=1}" type="hidden"/>
                        <p class="notic2">前台注册页面显示文案，可以为：注册协议，隐私协议等</p>
                    </dd>
                </dl>
                <dl class="row">
                    <dt class="tit">
                        <label for=""><em>*</em>协议内容</label>
                    </dt>
                    <dd class="opt">
                        {load href="__PUBLIC__/plugins/Ueditor/ueditor.config.js" /}
                        {load href="__PUBLIC__/plugins/Ueditor/ueditor.all.min.js" /}
                        {load href="__PUBLIC__/plugins/Ueditor/lang/zh-cn/zh-cn.js" /}
                        <textarea class="span12 ckeditor" id="reg_agreement_content" data-func="reg_agreement_content" name="agreement[1][content]">{$agreement[1]['content']|default=''}</textarea>
                        <span class="err"></span>
                        <p class="notic"></p>
                    </dd>
                    <script type="text/javascript">
                        var ue_reg_agreement_content = UE.getEditor('reg_agreement_content',{
                            serverUrl :"{:url('Ueditor/index',array('savepath'=>'allimg'))}",
                            zIndex: 999,
                            initialFrameWidth: "100%", //初化宽度
                            initialFrameHeight: 450, //初化高度
                            focus: false, //初始化时，是否让编辑器获得焦点true或false
                            maximumWords: 99999,
                            removeFormatAttributes: 'class,style,lang,width,height,align,hspace,valign',//允许的最大字符数 'fullscreen',
                            pasteplain:false, //是否默认为纯文本粘贴。false为不使用纯文本粘贴，true为使用纯文本粘贴
                            autoHeightEnabled: false,
                            toolbars: ueditor_toolbars
                        });
                        //必须在提交前渲染编辑器；
                        function reg_agreement_content() {
                            //判断编辑模式状态:0表示【源代码】HTML视图；1是【设计】视图,即可见即所得；-1表示不可用
                            if(UE.getEditor("reg_agreement_content").queryCommandState('source') != 0) {
                                UE.getEditor("reg_agreement_content").execCommand('source'); //切换到【设计】视图
                            }
                        }
                    </script>
                </dl>
                <div class="ncap-form-default">
                    <div class="bot2 e-l-110">
                        <a href="JavaScript:void(0);" class="ncap-btn-big ncap-btn-green w60" onclick="adsubmit();">保存</a>
                    </div>
                </div>
            </div>
        </form>
    </div>
</div>
<script type="text/javascript">

    $(function(){

    });

    function adsubmit(){
        if ($.trim($('#reg_agreement_title').val()) == '') {
            showErrorMsg('注册协议名称不能为空！');
            $('#reg_agreement_title').focus();
            return false;
        } else if (!UE.getEditor('reg_agreement_content').hasContents()) {
            showErrorMsg('注册协议内容不能为空！');
            UE.getEditor('reg_agreement_content').focus();
            return false;
        }
        layer_loading("正在处理");
        $('#handlepost').submit();
    }
    
    function web_logo_img_call_back(fileurl_tmp)
    {
        $("#web_logo_local").val(fileurl_tmp);
        $("#img_a_web_logo").attr('href', fileurl_tmp);
        $("#img_i_web_logo").attr('onmouseover', "layer_tips=layer.tips('<img src="+fileurl_tmp+" class=\\'layer_tips_img\\'>',this,{tips: [1, '#fff']});");
    }
    
    function web_ico_img_call_back(fileurl_tmp)
    {
        $("#web_ico").val(fileurl_tmp);
        $("#img_a_web_ico").attr('href', fileurl_tmp);
        $("#img_i_web_ico").attr('onmouseover', "layer_tips=layer.tips('<img src="+fileurl_tmp+" width=32 height=32>',this,{tips: [1, '#fff']});");
    }

    
    

    //过滤HTML标签
    function removeHTMLTag(str) {
        str = str.replace(/<\/?[^>]*>/g, ''); //去除HTML tag
        str = str.replace(/[ | ]*\n/g, '\n'); //去除行尾空白
        str = str.replace(/ /ig, ''); //去掉 
        return str;
    }

</script>

{include file="public/footer" /}